// <!-- 页面路径：store/index.js -->
import Vue from 'vue'
import Vuex from 'vuex'
import {
	spu
} from '@/api/applet/spu.js'
// 获取订单id
// import {
// 	inorderid
// } from '@/api/inOrderid.js'
Vue.use(Vuex); //vue的插件机制
//Vuex.Store 构造器选项
const store = new Vuex.Store({
	state: { //存放状态
		"list": [{
				iconPath: "/static/tabbar/pagehome2@2x.png",
				selectedIconPath: "/static/tabbar/pagehome@2x.png",
				text: '首页',
				count: 0, //红色角标显示的数字
				pagePath: "/pages/index/index",
			},
			{
				text: '商城',
				customIcon: false,
				iconPath: " /static/tabbar/shoping2@2x.png ",
				selectedIconPath: "/static/tabbar/shoping@2x.png",
				pagePath: "/pages/shoop/shoop",
			},
			{
				iconPath: "/static/tabbar/min_button.png",
				selectedIconPath: "/static/tabbar/min_button.png",
				text: '发布',
				midButton: true,
				customIcon: false,
			},
			{
				iconPath: "/static/tabbar/task@2x.png",
				selectedIconPath: "/static/tabbar/task2@2x.png ",
				text: '任务',
				customIcon: false,
				pagePath: "/pages/task/task",
			},
			{
				pagePath: "/pages/my/my",
				iconPath: "/static/tabbar/me@2x.png",
				selectedIconPath: "/static/tabbar/me2@2x.png",
				text: '我的',
				count: 0,
				isDot: false,
				customIcon: false,
			},
		],
		sku: [], //根据spu获取的sku
		orderId: '', //订单id
	},
	mutations: {
		spuid(state, payload) {
			spu(payload).then(res => {
				console.log(res, 'vuexresa')
				state.sku = res.data;
				 
			})
		},
		// inorder(state, payload) {
		// 	inorderid(payload).then(res => {
		// 		console.log(res, '获取订单号')
		// 		state.orderId = res.data.orderId;
		// 	})
		// }
	}
})
export default store
